package edu.njust.cma.mapper;

import edu.njust.cma.pojo.SmallProject;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SmallProjectMapper {

    @Insert("insert into small_project(project_id,standard_id) values(#{projectId},#{standardId})")
    void addSmallProject(int projectId, int standardId);

    @Select("select id from small_project where project_id=#{projectId} and standard_id=#{standardId}")
    int findIdByProjectIdAndStandardId(int projectId, int standardId);

    @Select("select standard_id from small_project where project_id=#{projectId}")
    List<Integer> getStandardIdByProjectId(Integer projectId);

    @Select("select project_id from small_project where id=#{Id}")
    Integer getProjectIdById(Integer Id);
    @Select("select * from small_project where project_id=#{projectId}")
    List<SmallProject> getSmallProject(Integer projectId);

    @Select("select id from small_project where project_id = #{projectId}")
    List<Integer> getSmallProjectId(Integer projectId);


    @Select("select * from small_project where project_id=#{projectId}")
    List<SmallProject> getSmallProjectByProjectId(int projectId);

    @Select("select * from small_project where id=#{smallProjectId}")
    SmallProject getSmallProjectById(int smallProjectId);
}
